<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //for循环
      
        for(var i=1;i<=100;i++){
            console.log(i);
        }
        //for循环实操
        //循环输出1-100之间数字的和
        var x = 100;
        var num = 0;
        for(var i=1;i<=100;i++){
            num+=i;
        }
        console.log(num);
        //循环输出1000以内的奇数
        var y = 1000;
        for(var i=0;i<1000;i++){
            if(i%2!=0){
                console.log(i);
            }
        }
        //打印九九乘法表
        var sum = 0;
        for(var i =1;i<=9;i++){
            document.write("<br>")
            for(var j = 1;j<=i;j++){
                sum = i*j;
                document.write(i + "*" + j + "=" + sum +"   ");
           }
        }

        //while循环
        //打印1-100的值
        var i=1;
        while(i<=100){
             console.log(i);
             i++;
        }

        //break语句和continue语句：都具有跳转作用
        //如果i的值等于5则不再执行下去
        for(var i=0;i<100;i++){
            // console.log(i);
            if(i==5){
                break;
            }
            console.log(i);
        }

        for(var i=0;i<100;i++){
            // console.log(i);
            if(i==5){
                continue;
            }
            console.log(i);
        }


    </script>
</body>
</html>